#!/bin/sh

if [ $# -lt 1 ]; then 
	echo "Usage: $0 number startdate"
	exit
fi

if [ $# -gt 2 ]; then 
	echo "Usage: $0 number startdate"
	exit
fi

if [ $# -eq 1 ]; then 

	t_today=`date -I`

elif [ $# -eq 2 ]; then 

	t_today=$2

fi

counter=0

((lend=$1-1))

while true
do 
	if [ $counter -gt $lend ]; then
		exit
	fi
	`printf "date -j -v +%dd -f \"%%Y-%%m-%%d\" \"%s\"\n" $counter $t_today` | awk '{
		for (i=1;i<NF-2;i++) {
			printf $i 
		}
		print "\t" $i
	}'

	((counter=counter+1))
done
